<template>
  <div>
    <OrderTable ref="refOrderList" :statusList="statusList" :statusValue="statusValue"
                @openPurchaseInfo="openPurchaseInfo" @openSendInfo="openSendInfo"/>
    <!--    上传采购信息-->
    <UploadPurchaseInfo v-if="isOpenPurchaseInfo" :childOrderId="childOrderId" @close="closePurchaseInfo"/>
    <!--  上传发货信息  -->
    <UploadSendInfo v-if="isOpenSendInfo" :orderId="orderId" @close="closeSendInfo"/>
  </div>
</template>

<script>
import OrderTable from "@/views/order/components/OrderTable.vue";
import UploadPurchaseInfo from "@/views/order/components/UploadPurchaseInfo.vue";
import UploadSendInfo from "@/views/order/components/UploadSendInfo.vue";

export default {
  name: "selfShipmentOrder",
  components: {
    OrderTable,
    UploadPurchaseInfo,
    UploadSendInfo
  },
  data() {
    return {
      statusList: ['111'],
      statusValue: "111",
      childOrderId: "",
      isOpenPurchaseInfo: false,//是否打开采购信息弹窗
      isOpenSendInfo: false,//是否打开发货信息弹窗
      orderId: "",
    }
  },
  created() {

  },
  methods: {
    // 打开上传采购信息弹窗
    openPurchaseInfo(row) {
      this.childOrderId = row.childOrderId
      this.isOpenPurchaseInfo = true
    },
    // 关闭上传采购信息弹窗
    closePurchaseInfo(isRefresh) {
      if (isRefresh == '1') {
        this.$refs.refOrderList.getList()
      }
      this.isOpenPurchaseInfo = false
    },
    // 打开上传发货信息弹窗
    openSendInfo(row) {
      this.orderId = row.orderId
      this.isOpenSendInfo = true
    },
    // 关闭上传发货信息弹窗
    closeSendInfo(e, isRefresh) {
      this.isOpenSendInfo = false
      if (isRefresh == '1') {
        this.$refs.refOrderList.getList()
      }
    },
  }
}
</script>

<style scoped>

</style>
